package com.lipaluma.test.db.internal;

import org.springframework.context.ApplicationContext;
import org.springframework.test.context.TestContext;

/**
 * Current context of the test
 * @author Mario
 */
public final class Context {
	private static ApplicationContext applicationContext;
	private static Class<?> testedClass;
	private static TestContext testContext;
	
	public static void init(ApplicationContext applicationContext, TestContext testContext) {
		Context.applicationContext = applicationContext;
		Context.testContext = testContext;
		Context.testedClass = testContext.getTestClass();
	}
	
	/**
	 * get the current Spring application context
	 * @return
	 */
	public static ApplicationContext getApplicationContext() {
		return applicationContext;
	}
	
	/**
	 * get the tested Class
	 * @return
	 */
	public static Class<?> getTestedClass() {
		return testedClass;
	}
	
	/**
	 * get the Context of the current test
	 * @return
	 */
	public static TestContext get() {
		return testContext;
	}
}
